using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

    //猫、狗、鸭、猴，（吃、游泳、爬树）
    //所有动物都有吃的方法
    //狗和鸭会游泳，不会爬树
    //猫和猴不会游泳会爬树
    //将吃的方法定义在父类方法中，将游泳和爬树的技能定义为接口
    //所有子类继承父类后，再去继承相应的接口实现技能

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("爬树");
            IClimbTree ict = new Cat();
            ClimbTree(ict);

            IClimbTree ict1 = new Monkey();
            ClimbTree(ict1);
            Console.WriteLine("————————————————");
            
            Console.WriteLine("游泳");
            ISwim swim = new Duck();
            Swim(swim);

            ISwim swim1 = new Dog();
            Swim(swim1);
            Console.WriteLine("————————————————");

            Console.WriteLine("吃");
            Animal a = new Dog();
            Eat(a);

            Animal a1 = new Cat();
            Eat(a1);

            Animal a2 = new Duck();
            Eat(a2);

            Animal a3 = new Monkey();
            Eat(a3);

        }
        static void ClimbTree(IClimbTree ict)
        {
            ict.ClimbTree();
        }
        static void Swim(ISwim iswim)
        {
            iswim.swim();
        }
        static void Eat(Animal animal)
        {
            animal.eat();
        }
    }
}
